package test1;

    public class Thoroughbred {
        // 私有属性
        private String mother;
        private String father;
        private int birthYear;

        // 构造函数
        public Thoroughbred(String mother, String father, int birthYear) {
            this.mother = mother;
            this.father = father;
            this.birthYear = birthYear;
        }

        // 获取当前年龄的操作
        public int getCurrentAge() {
            int currentYear = java.time.Year.now().getValue();
            return currentYear - birthYear;
        }

        // 获取父母的操作
        public String getFather() {
            return father;
        }

        public String getMother() {
            return mother;
        }
        public int getBirthYear(){
            return birthYear;
        }
    }









